Skip to content

make select optional on a query - #148

Merged
samwillis merged 13 commits into
mainfrom
samwillis/optional-select
Jun 9, 2025
Merged

samwillis merged 13 commits into
mainfrom
samwillis/optional-select

Conversation

@samwillis

Copy link
Copy Markdown
Collaborator

this makes the select operator optional.

  • for simple single input queries it will return the whole object for each row at the top level
  • for joins it will return a name spaced object - for example joins users to comments will result in:
{
  comment: { /* ... */ }
  user: { /* ... */ }
}
  • groupBy still requires a select as it needs the aggregate functions to be defined there.

The types on the returned collection are correct for all variants of a query.

@changeset-bot

changeset-bot Bot commented Jun 8, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b4fdbb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@tanstack/db Patch
@tanstack/db-collections Patch
@tanstack/react-db Patch
@tanstack/vue-db Patch
@tanstack/db-example-react-todo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@samwillis
samwillis requested a review from KyleAMathews June 8, 2025 18:13
@pkg-pr-new

pkg-pr-new Bot commented Jun 8, 2025 •

Copy link
Copy Markdown

@tanstack/db-example-react-todo

npm i https://pkg.pr.new/@tanstack/db@148
npm i https://pkg.pr.new/@tanstack/db-collections@148
npm i https://pkg.pr.new/@tanstack/react-db@148
npm i https://pkg.pr.new/@tanstack/vue-db@148

commit: 3b4fdbb

@samwillis
samwillis force-pushed the samwillis/optional-select branch from 00bdd86 to a11b29b Compare June 9, 2025 08:18

@KyleAMathews KyleAMathews left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 :shipit:

Base automatically changed from samwillis/key-all-streams to main June 9, 2025 13:10
@samwillis
samwillis merged commit 338efc2 into main Jun 9, 2025
@samwillis
samwillis deleted the samwillis/optional-select branch June 9, 2025 13:16
@github-actions github-actions Bot mentioned this pull request Jun 9, 2025
cursor Bot pushed a commit that referenced this pull request Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants